#include "imageshowlabel.h"

ImageShowLabel::ImageShowLabel(QWidget *parent) : QLabel(parent)
{

}

void ImageShowLabel::paintEvent(QPaintEvent *)
{
    if (g_showImage.isNull())
    {
        return ;
    }
    QPainter p(this);
    int showx, showy, showwidth, showheight;
    QImage image = ScaleImage2Label(g_showImage, this, showx, showy, showwidth, showheight);
    p.drawPixmap(showx, showy, showwidth, showheight, QPixmap::fromImage(image));
}
